﻿using System;
using System.Web;

namespace Clarke.UI.Helpers
{
	public class FileHelper
	{
		public static string SaveFile(HttpPostedFileWrapper fileWrapper)
		{
			var filename = string.Format(@"{0}\{1}", AppVar.StorageImage, DateTime.Now.ToString("yyyyMMddhhmmss-") + fileWrapper.FileName);
			var fullFilePath = string.Format(@"{0}\{1}", HttpContext.Current.Request.PhysicalApplicationPath, filename);
			fileWrapper.SaveAs(fullFilePath);
			return filename;
		}
	}
}